-
Notifications
You must be signed in to change notification settings - Fork 38.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waiting attach operation to be finished rather than returning nil #47018
Conversation
Hi @FengyunPan. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/release-note-none |
@k8s-bot ok to test |
pkg/volume/cinder/attacher.go
Outdated
} | ||
} else { | ||
return false, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rewrite this as
if err != nil {
return false, err
}
return !pending, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/volume/cinder/attacher.go
Outdated
} | ||
} else { | ||
return false, err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar thing, it is easier to read:
if err != nil {
return false, err
}
return attached, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
pkg/volume/cinder/attacher.go
Outdated
if err = attacher.waitDiskAttached(instanceID, volumeID); err != nil { | ||
glog.Errorf("Error waiting for volume %q to be attached from node %q: %v", volumeID, nodeName, err) | ||
return "", err | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need of else
here I think, because return will anyway make the control to return from the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/approve |
/lgtm Thanks for doing this so quickly! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FengyunPan, msau42, saad-ali Associated issue: 46882 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 46977, 47005, 47018, 47061, 46809) |
Automatic merge from submit-queue (batch tested with PRs 46977, 47005, 47018, 47061, 46809) Waiting attach operation to be finished rather than returning nil Fixes kubernetes#46882
Fixes #46882